package com.itheima.dao;

import com.itheima.domain.Account;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;

@Component
public interface AccountDao {

    @Update("update account set money=money+#{money} where id=#{id}")
    void transfer(@Param("id") Integer Id, @Param("money") Double money);

    @Select("select id,name,money from account")
    List<Account> findAll();
}
